﻿<%@ WebHandler Language="C#" Class="wxMiniProgramLogin" %>
using Models;
using System;
using System.Web;
using Newtonsoft.Json;
using System.Linq;
using System.Web.Configuration;
using Newtonsoft.Json.Linq;
using System.IO;
using System.Net;



public class wxMiniProgramLogin : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";



        string openid = context.Request.Headers["X-ACCESS-USER"];//Header中的token

        var orderid =context.Request.Form["oid"];


        using (Entities db = new Entities())
        {

            int oid = int.Parse(orderid);
            var code = 1;
            var msg = "订单详情";
            var time = DateTime.Now;
            var x = db.S_Order.SingleOrDefault(p => p.OrderID == oid);

            var data = new
                {
                    OrderID =x.OrderID,
                    x.OOrderNumber,
                    OLastPrice=_rky.getSordeSumMoney(x.OrderID.ToString()),
                    x.OCreatTime,
                    x.SPName,
                    x.OState,
                };




            context.Response.Write(JsonConvert.SerializeObject(new { code,msg,time,data}));
            HttpContext.Current.Response.End();

        }




    }



    public bool IsReusable {
        get {
            return false;
        }
    }

}